package com.weimengchao.redisson.config;

import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.context.environment.EnvironmentChangeEvent;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;

/**
 * @description:
 * @author: 魏孟超
 * @createDate: 2021-11-23 0:47
 */
@Slf4j
@Configuration
public class EnvConfiguration {

    @EventListener
    public void envListener(EnvironmentChangeEvent event) {
        System.out.println("变更通知: " + event);
        for (String key : event.getKeys()) {
            log.debug("变更通知 key{}, value:{}", key, event.getSource());
        }
    }

}
